<link href="//ai.jinyunweb.com/core/resource/css/robotpc.css" rel="stylesheet">
<style>
.robot .talk-content .r .pic{background: url('{{tomedia(pagedata.siteinfo.logo,true) || '../core/resource/images/gw-wx.png'}}') no-repeat;background-size: 100% 100%;}
.robot .talk-content .l .pic{background: url('{{tomedia(main.llogo2,true) || '../core/resource/images/noavatar.gif'}}') no-repeat;background-size: 100% 100%;}
.modal-open {
	overflow: hidden;
	padding:0!important;
}
</style>
<script>
// 客服弹框 鼠标放上事件
    $('.jdm-toolbar-tab').hover(function() {
        $(this).find('.tab-text,.tab-qrcode').css("display", "flex");
        $(this).siblings().find('.tab-text,.tab-qrcode').hide();
    }, function() {
        $(this).find('.tab-text,.tab-qrcode').hide();
    });
</script>
<div class="toolbar" ng-if="main.closed_kefublock !=1">
  <div class="jdm-toolbar bai">
	<div class="jdm-toolbar-tabs" style="top:160px">
      <div class="jdm-toolbar-tab" onmouseover="$(this).find('#showinfo').show()" onmouseleave="$(this).find('#showinfo').hide()">
		 <a href="./index.php?plugin=core&action=article.show&nosession=1" target="_blank">
			<img class="tab-ico" src="../core/resource/images/wxapp-white.png" style="width:31px;padding:5px 3px"/>
			<div id="showinfo">
				<div id="wxapp-showinfo" ng-init="tool.wxapp_qr(config('siteroot'),'wxapp-showinfo',108,true)"></div>
				<em style="display: block;">小程序端访问</em>
			</div>
		</a>
      </div>
	  <div class="jdm-toolbar-tab" onmouseover="$(this).find('#showinfo').show()" onmouseleave="$(this).find('#showinfo').hide()">
		 <a href="./index.php?plugin=core&action=article.show&nosession=1" target="_blank">
			<img class="tab-ico" src="../core/resource/images/mobile-white.png" style="width:31px;padding:5px 3px"/>
			<div id="showinfo">
				<div id="qrcode-showinfo" ng-init="tool.qr(config('siteroot'),'qrcode-showinfo',108,true)"></div>
				<em style="display: block;">手机端访问</em>
			</div>
		</a>
      </div>
	</div>
    <div class="jdm-toolbar-tabs">
      <div class="jdm-toolbar-tab" ng-show="main.closed_shouce !=1" onmouseover="$(this).find('.tab-text').show()" onmouseleave="$(this).find('.tab-text').hide()">
		 <a href="./index.php?plugin=core&action=article.show&nosession=1" target="_blank">
			<i class="tab-ico fa fa-question"></i>
			<em class="tab-text">使用手册</em>
		 </a>
      </div>
      <div class="jdm-toolbar-tab" ng-show="main.closed_mkefu !=1" onmouseover="$(this).find('.tab-text').show()" onmouseleave="$(this).find('.tab-text').hide()">
	  <a href="javascript:;" data-toggle="modal" data-target="#followrobot" target="_blank">
        <i class="tab-ico fa fa-qq" style="padding-top:8px;font-size:17px"></i>
        <em class="tab-text">在线客服</em>
	  </a>
      </div>
      <div class="jdm-toolbar-tab" ng-show="main.closed_alipay !=1" onmouseover="$(this).find('.tab-qrcode').show()" onmouseleave="$(this).find('.tab-qrcode').hide()" >
        <i class="tab-ico fa fa-qrcode"></i>
        <img class="tab-qrcode" ng-src="{{tomedia(main.alipay,true) || '../core/resource/images/nopic.jpg'}}"/>
      </div>
	  <div class="jdm-toolbar-tab" ng-show="main.closed_wxpay !=1" onmouseover="$(this).find('.tab-qrcode').show()" onmouseleave="$(this).find('.tab-qrcode').hide()">
        <i class="tab-ico fa fa-qrcode"></i>
        <img class="tab-qrcode" ng-src="{{tomedia(main.wxpay,true) || '../core/resource/images/nopic.jpg'}}"/>
      </div>
	  <div class="jdm-toolbar-tab" ng-show="main.closed_ewm !=1" onmouseover="$(this).find('.tab-qrcode').show()" onmouseleave="$(this).find('.tab-qrcode').hide()">
        <i class="tab-ico fa fa-wechat" style="font-size:18px;padding:8px 5px"></i>
        <img class="tab-qrcode" ng-src="{{tomedia(main.ewm,true) || '../core/resource/images/nopic.jpg'}}"/>
      </div>
	  <div class="jdm-toolbar-tab" ng-show="main.closed_phone !=1" onmouseover="$(this).find('.tab-text').show()" onmouseleave="$(this).find('.tab-text').hide()">
        <i class="tab-ico fa fa-phone"></i>
        <em class="tab-text" style="width:98px;left:-96px">{{main.phone}}</em>
      </div>
    </div>
    <div class="jdm-toolbar-footer">
      <div class="jdm-toolbar-tab jdm-tbar-tab-top" ng-show="main.closed_angleup !=1">
        <a href="javascript:scroll(0,0)">
          <i class="tab-ico fa fa-angle-up"></i>
          <em class="tab-text">顶部</em></a>
      </div>
      <div class="jdm-toolbar-tab jdm-tbar-tab-feedback" ng-show="main.closed_feedback !=1">
        <a href="javascript:;" data-toggle="modal" data-target="#feedback" target="_blank">
          <i class="tab-ico fa fa-comment-o" style="padding-top:8px;font-size:17px"></i>
          <em class="tab-text">反馈</em></a>
      </div>
    </div>
  </div>
</div>
<div id="feedback" class="modal fade" tabindex="-1" style="z-index:1039;display:none">
    <div class="jinyun-modal-dialog modal-dialog" style='top:50%;width: 920px;'>
        <div class="modal-content">
			<div class="modal-body form-horizontal" style="padding:0">
			<style>
				.c_customize_container p{font-size:16px;width:65%;margin:0 auto;line-height:30px}
				.c_cust_title{font-size:35px;color:#2d8efe}
				.c_customize_container textarea{resize:none}
				.c_customize_container form{margin:50px auto;width:65%}
				.c_customize_container .form-group{margin-bottom:30px}
				.c_customize_container .form-control{height:40px}
				.c_customize_container .form-control-textarea{height:auto}
				.c_customize_container button{padding:8px 60px;background:#2d8efe;border:none;color:#fff;margin:30px 0}
				.c_customize_container button:hover{color:#fff}
			</style>
			 <!--需求start  -->
			  <div class="container text-center c_join_item c_customize_container">
				<div class="c_cust_title">意见反馈</div>
				<p>提交您的意见，建议！</p>
				<form role="form" id='myform'>
				  <div class="row">
					<div class="col-md-6 col-xs-12 col-sm-12">
					  <div class="form-group">
						<input type="text" class="form-control username"  placeholder="姓名">
					  </div>
					</div>
					<div class="col-md-6 col-xs-12 col-sm-12">
					  <div class="form-group">
						<input type="tel" class="form-control userphone"  placeholder="手机号码">
					  </div>
					</div>
					<div class="col-md-12 col-xs-12 col-sm-12">
					  <div class="form-group">
						<input type="text" class="form-control useremail"  placeholder="邮箱">
					  </div>
					</div>
					<div class="col-md-12 col-xs-12 col-sm-12">
					  <textarea class="form-control form-control-textarea useridear" rows="5" placeholder="具体的意见，需求！"></textarea>
					</div>
				  </div>
				  <button type="button" class="btn  btn-lg" onclick="Submit()" data-dismiss="modal" aria-hidden="true">提交</button>
				</form>
			  </div>
			  <!--需求end  -->
			<script type="text/javascript">
			  function head_nav(){
				$(".c_head_nav").toggle()
			  }
			  function Submit(){
				var username = $(".username").val();
				var userphone = $(".userphone").val();
				var useremail = $(".useremail").val();
				var useridear = $(".useridear").val();
				var str = /^[1][3,4,5,7,8][0-9]{9}$///手机
				var strname =  /^[\u4e00-\u9fa5]+(·[\u4e00-\u9fa5]+)*$/ //中文
				var stremail = /^[A-Za-z0-9\u4e00-\u9fa5]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/
				if(username == ''){
				  alert("请输入姓名！")
				  return false
				}
				if(!(strname.test(username))){
				  alert("请输入中文姓名！")
				  return false
				}
				if(userphone == ''){
				  alert("请输入手机号码！")
				  return false
				}
				if(!(str.test(userphone))){
				  alert("请输入正确的手机号码！")
				  return false
				}
				if(useremail == ''){
				  alert("请输入邮箱！")
				  return false
				}
				if(!(stremail.test(useremail))){
				  alert("请输入正确的邮箱！")
				  return false
				}
				if(useridear == ''){
				  alert("请输入需要定制的内容")
				  return false
				}

				var params1 = {
								'plugin':'core',
								'action':'system.message',
								'op':'feedback',
								'data': {name:username,phone:userphone,email:useremail,content:useridear},
								'callback':function(data){
										console.log(data)
										if(data.success == 1){
											 $('#myform')[0].reset();
											 alert('留言成功!');
										}else{
											 alert(data.message);
										}
								}
				}
				scope.post_json(params1);

			  }
			</script>
			</div>
        </div>
    </div>
</div>
<div id="followrobot" class="modal fade" tabindex="-1" style="z-index:1039;display:none">
    <div class="jinyun-modal-dialog modal-dialog" catchtouchmove='true' style='top:50%;width: 920px;'>
        <div class="modal-content">
			<div class="modal-body form-horizontal" style="padding:0">
				<div class="col-jy-8" style="padding:0">
					<div class="robot">
						<div class="geet-wrap" style="display: none;"><div id="geet" class="geet-con"></div></div>
						<div class="con" id="demoSendBox" style="margin: 0 auto;">
								<div class="con-head">
								<div class="head-l" style="background: url('{{tomedia(main.icon,true) || '../core/resource/images/logoicon.png'}}') 0% 0% / 100% 100% no-repeat;"></div>
									<div class="head-r">
									<p class="p1" style="padding-bottom:0px">{{main.name}}</p> 
									<p class="p2">{{main.title}}</p>
									</div>
								</div>
								<div class="talk-content">
									<div class="t-w">
										<div class="talk-box">
										<div class="talk-wrap" style="height:320px;overflow-y:scroll;overflow-x:hidden">
											<div id="svposttext">
											 
											</div>
										</div>
										</div>
									</div>
									<div class="inp-box" >
										<form action="" method="get" class="form-horizontal form">
										<div class="content_type" id="text">
												<input class="inp" type="text" id="contentvalue" ></input>
												<div class="sub-btn" onclick="submitform()"></div>
										</div>	
										</form>
									</div>					
								</div>
								</div>
					</div>
					<script type="text/javascript">
						require(['jquery'], function($){
							$('.content_type').hide();
							$('#text').show();
							toggle('text');
						});
						
						function toggle(type) {
							curtype = type;
							$('.content_type').hide();
							$("#" + curtype).show();

							buildRequest(type);
							$('#receive').text('');
							$('#svposttext').hide();
							$('#svtext').hide();
							$('#svurlbox').hide();
							$('#sendxml').attr('readonly', 'readonly');
							if(type == 'other') {
								$('#sendxml').removeAttr('readonly');
							}
						}

						function getxml(xmlstring){
							var xmlobject = null;
							try{
								if(window.ActiveXObject){
									xmlobject =new ActiveXObject("Microsoft.XMLDOM");
									xmlobject.async="false";
									xmlobject.loadXML(xmlstring);
								}else{// 用于 Mozilla, Firefox, Opera, 等浏览器的代码：
									var parser=new DOMParser();
									xmlobject =parser.parseFromString(xmlstring,"text/xml");
								}
							}catch(e){alert("您的浏览器不支持模拟测试");}
							return xmlobject;
						}
						function buildRequest(type) {
							var $demoSendBox = $('#demoSendBox');
							$('span.time', $demoSendBox).show();
							$('div.mediaImg', $demoSendBox).show();
							$('div.mediaContent', $demoSendBox).show();
							$('div.mediaFooterbox', $demoSendBox).show();
							var time = Math.round(new Date().getTime()/1000);
							xml = 	"<xml>\n"+
								"<ToUserName><![CDATA["+$('#touser').val()+"]]></ToUserName>\n"+
								"<FromUserName><![CDATA["+$('#fromuser').val()+"]]></FromUserName>\n"+
								"<CreateTime>"+time+"</CreateTime>\n";
							if (type == 'text') {
								xml += "<MsgType><![CDATA[text]]></MsgType>\n";
								xml += "<Content><![CDATA["+$('#contentvalue').val()+"]]></Content>\n";
								$('#svpostinfo').text($('#contentvalue').val());
							}
							xml +=  "<MsgId>1234567890123456</MsgId>\n"+
								"</xml>";
							if(type == 'other') {
								xml = $('#sendxml').val();
							}
							$('#sendxml').val(xml);
						}
						

						function submitform() {
								$('#process').hide();
								buildRequest(curtype);
								$('#svtext').hide();$('#svurlbox').hide();$('#svinfolist').hide();
								$('div.mediaFooterbox', $('#sendbox')).show();
								var text = $('#contentvalue').val();
								scope.post_json('core/home.kefu/chat/',{msg:text},function(data){
											if(data.error !=1){
												$('#svposttext').show();
													$('#svposttext').append('<div class="r clearfix"><img class="pic"/><p class="text">'+text+'</p></div>');
													$('#contentvalue').val('');
													
												if(data.msg){
													$('#svposttext').append('<div class="l clearfix"><img class="pic"/><p class="text">'+data.msg+'</p></div>');
												}
											}else{
												scope.message(data.msg,'error');
											}
								});	
						}		
						function cs(){
						var div = document.getElementById('svposttext');   
							div.scrollTop = div.scrollHeight;
				}
						function nl2br(str, is_xhtml) {
							var breakTag = (is_xhtml || typeof is_xhtml === 'undefined') ? '<br ' + '/>' : '<br>'; // Adjust comment to avoid issue on phpjs.org display
							return (str + '').replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, '$1' + breakTag + '$2');
						}
					</script>
				</div>
				<div class="col-jy-4" style="padding:0">
					<div class="robot-right">
						<div class="rblogo t-c"><img class="avatar img-circle" ng-src="{{tomedia(main.icon,true) || '../core/resource/images/logoicon.png'}}"></div>
						<div class="kefu-title">
							<h1 style="font-size:18px;text-align: center;">-- 人工客服 --</h1>
						</div>
						<div class="kefulist">
							<a href="http://wpa.qq.com/msgrd?v=3&amp;uin={{main.qq}}&amp;site=qq&amp;menu=yes">
							<div class="item flex">
								<div class="right flex">
									<div class="kefuname">QQ客服</div>
									<i class="fa fa-qq"></i>
								</div>
							</div>
							</a>
							<a>
								<div class="item flex">
									<div class="right flex">
										<div class="kefuname">微信客服</div>
										<i class="fa fa-wechat"></i>
									</div>
								</div>
								<div style="width:108px;margin:auto;text-align:center;">
									<img style="width:108px;height:108px" ng-src="{{tomedia(main.kfewm,true) || '../core/resource/images/wechat.jpg'}}"/>
									<span>客服微信二维码</span>
								</div>
							</a>
						</div>
						<div class="kefu-menu"><a href="#" class="btn btn-primary" style="padding:1px 12px" ng-click="modal_result(modaldata.image)">24小时-智能客服</a></div>
					</div>
				</div>
			</div>
        </div>
    </div>
</div>